    // 检验是否有 token 
    if (!localStorage.getItem('token')) location.href = "./login.html"

    document.querySelector('.username').innerHTML = localStorage.getItem('uname')

    // 退出登录
    document.querySelector('#logout').addEventListener('click', () => {
      // 清除所有存在本地的数据
      localStorage.clear()
      location.href = "./login.html"
    })